package com.blog.message.api.MQconsumer;


import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.*;
import org.springframework.stereotype.Component;

import static com.blog.message.api.constant.QueueConstant.*;

/**
 * <p>
 * 配置消费者
 * </p>
 *
 * @author Valerie
 * @date 2023/5/27
 **/
@Component
@RabbitListener(
        ackMode = "MANUAL",
        bindings = @QueueBinding(
                value = @Queue(name = CONFIG_QUEUE, durable = TRUE),
                exchange = @Exchange(name = TOPIC_EXCHANGE, durable = FALSE, type = ExchangeTypes.TOPIC),
                key = CONFIG_KEY
        )
)
public class ConfigConsumer {


        @RabbitHandler
        public void setPageCover(Message message, Channel channel){
                // todo
        }

}
